use core::{Package, Target, PackageId, PackageSet};
use util::{CargoResult, human, Human};
-use util::{internal, ChainError};
+use util::{internal, ChainError, profile};
use super::job::Work;
use super::{fingerprint, process, Kind, Context, Platform};
/// only run once (not twice).
pub fn prepare(pkg: &Package, target: &Target, req: Platform,
cx: &mut Context) -> CargoResult<(Work, Work, Freshness)> {
+ let _p = profile::start(format!("build script prepare: {}/{}",
+ pkg, target.name()));
let kind = match req { Platform::Plugin => Kind::Host, _ => Kind::Target, };
let (script_output, build_output) = {
(cx.layout(pkg, Kind::Host).build(pkg),
cx: &mut Context<'a, 'cfg>,
jobs: &mut JobQueue<'a>) -> CargoResult<()> {
debug!("compile_pkg; pkg={}", pkg);
- let profiling_marker = profile::start(format!("preparing: {}", pkg));
// For each target/profile run the compiler or rustdoc accordingly. After
// having done so we enqueue the job in the right portion of the dependency
continue
}
+ let profiling_marker = profile::start(format!("preparing: {}/{}",
+ pkg, target.name()));
let work = if profile.doc {
let rustdoc = try!(rustdoc(pkg, target, profile, cx));
vec![(rustdoc, Kind::Target)]
};
dst.push((Job::new(dirty, fresh), freshness));
}
+ drop(profiling_marker);
+
+ // Be sure to compile all dependencies of this target as well.
+ for &(pkg, target, p) in cx.dep_targets(pkg, target, profile).iter() {
+ try!(compile(&[(target, p)], pkg, cx, jobs));
+ }
// If this is a custom build command, we need to not only build the
// script but we also need to run it. Note that this is a little nuanced
jobs.queue(pkg, Stage::BuildCustomBuild).pop();
}
}
- drop(profiling_marker);
-
- // Be sure to compile all dependencies of this target as well. Don't recurse
- // if we've already recursed, however.
- for &(target, profile) in targets {
- for &(pkg, target, p) in cx.dep_targets(pkg, target, profile).iter() {
- try!(compile(&[(target, p)], pkg, cx, jobs));
- }
- }
Ok(())
}